import socket,time
from signal_generator_json import SignalGeneratorJsonx

PORT = 8081
   
def main():
    host_ip = socket.gethostbyname(socket.gethostname())
    udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sj = SignalGeneratorJsonx()
    
    dest_addr = (host_ip, PORT)
    while True:
        udp_socket.sendto(sj.get_json_array().encode('utf-8'), dest_addr)
        time.sleep(0.05)

    udp_socket.close()

if __name__ == '__main__':
    main()
